
/*!
 * \file      coloredshape.cpp
 * \brief     ColoredShape implementation.
 * \author    Duriez Franck
 * \author    Carton Paul-Henri
 * \version   0.1
 */

#include "constant.h"
#include "assert_macros.h"
#include "coloredshape.h"

ColoredShape::ColoredShape(QSFMLWidget *displayWidget, QObject *parent, float *dt) : /*{{{*/
	    Shape(displayWidget, parent, dt)
{
} /*}}}*/

Square* ColoredShape::mySquareType(int*, int, ShapeType atype) /*{{{*/
{
	// returned variable
	Square* res = (Square*) NULL;

	// Attribute the good Color to each ShapeType
	switch (atype) {
	case Shape::I :
	    res = new ColoredSquare(displayer, dt, sf::Color::Blue);
	    break;
	case Shape::O :
	    res = new ColoredSquare(displayer, dt, sf::Color::Green);
	    break;
	case Shape::T :
	    res = new ColoredSquare(displayer, dt, sf::Color::Red);
	    break;
	case Shape::L :
	    res = new ColoredSquare(displayer, dt, sf::Color::Yellow);
	    break;
	case Shape::J :
	    res = new ColoredSquare(displayer, dt, sf::Color::Magenta);
	    break;
	case Shape::Z :
	    res = new ColoredSquare(displayer, dt, sf::Color::White);
	    break;
	case Shape::S :
	    res = new ColoredSquare(displayer, dt, sf::Color::Cyan);
	    break;
	}

	return res;
} /*}}}*/

